import http from "@/common/http/request";
import {
  systemMenuListInterface,
  systemMenuAddInterface,
  systemMenuUpdateInterface,
} from "./menu.interface";

// 菜单列表
export const $systemMenuList = (data: systemMenuListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/system/menu/list',
    data,
  })
}

// 菜单详情
export const $systemMenuDetail = (data: string) => {
  const $http = new http();
  return $http.get({
    url: `/system/menu/${data}`,
  })
}

// 菜单新增
export const $systemMenuAdd = (data: systemMenuAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/system/menu',
    data,
  })
}

// 菜单新增
export const $systemMenuUpdate = (data: systemMenuUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/system/menu',
    data,
  })
}

// 菜单删除
export const $systemMenuDelete = (data: string) => {
  const $http = new http();
  return $http.delete({
    url: `/system/menu/${data}`,
  })
}